package com.soecode.wxtools.bean;

import java.io.IOException;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

import com.soecode.wxtools.bean.result.WxError;

/**
 * 在线客服
 * @author lenovo
 *
 */
public class WxOnlineKf extends WxError {

	private String kf_account;
	private String status;
	private int kf_id;
	private String accepted_case;

	public String getKf_account() {
		return kf_account;
	}

	public void setKf_account(String kf_account) {
		this.kf_account = kf_account;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public int getKf_id() {
		return kf_id;
	}

	public void setKf_id(int kf_id) {
		this.kf_id = kf_id;
	}

	public String getAccepted_case() {
		return accepted_case;
	}

	public void setAccepted_case(String accepted_case) {
		this.accepted_case = accepted_case;
	}

	@Override
	public String toString() {
		return "WxOnlineKf [kf_account=" + kf_account + ", status=" + status + ", kf_id=" + kf_id + ", accepted_case="
				+ accepted_case + "]";
	}

	/**
	 * json --> obj
	 * 
	 * @param json
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws IOException
	 */
	public static WxOnlineKf fromJson(String json) throws JsonParseException, JsonMappingException, IOException {
		ObjectMapper mapper = new ObjectMapper();
		mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
		return mapper.readValue(json, WxOnlineKf.class);
	}
}
